Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pacist.diamonds.PolygonUtil
Method Summary | |
static java.awt.Polygon | reflectPolygon(java.awt.Polygon p,
boolean leftRight,
boolean topBottom)
Reflects a polygon across the X and/or Y axis. |
static java.awt.Polygon | spinPolygon(java.awt.Polygon p,
int centreX,
int centreY,
int count)
Rotates a polygon count degrees clockwise about the co-ordinates centreX and centreY . |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Method Detail |
public static java.awt.Polygon reflectPolygon(java.awt.Polygon p, boolean leftRight, boolean topBottom)
p
- the polygon to reflect.
leftRight
- true
to flip across the Y axis; false
otherwise.
topBottom
- true
to flip across the X axis; false
otherwise.Polygon
- a new reflected polygon.public static java.awt.Polygon spinPolygon(java.awt.Polygon p, int centreX, int centreY, int count)
count
degrees clockwise about the co-ordinates centreX
and centreY
.
p
- the polygon to rotate.
centreX
- the X co-ordinate to rotate around.
centreY
- the Y co-ordinate to rotate around.
count
- the number of degrees to rotate clockwise.Polygon
- the newly rotated polygon.Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |